const swaggerJSDoc = require('swagger-jsdoc')

// swagger definition
const swaggerDefinition = {
  info: {
    title: 'API接口文档',
    version: '2.1.0',
    description: 'swagge',
  },
  host: '',
  basePath: '/',
}

// initialize swagger-jsdoc
export default function () {
  // options for the swagger docs
  const options = {
    // import swaggerDefinitions
    swaggerDefinition: swaggerDefinition,
    // path to the API docs
    apis: [
      './src/controllers/api/**/*.*',
      './src/controllers/units/**/*.*',
      './src/controllers/common/**/*.*',
    ],
  }
  return swaggerJSDoc(options)
}
